home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / gfx / edit / AmiCAD_2.07.lha / AmiCAD / ARexx / SauverAuto.AmiCAD < prev    next >
Text File  |  2000-11-11  |  3KB  |  80 lines

  1. /* Sauvegarde automatique   Saint-James, 13 février 1994    Version 1.01 */
  2. /*                Saint-James,  4 juin    1994    Version 1.02 */
  3. /* Modification nom clip    Saint-James,  7 juillet 1994    Version 1.03 */
  4. /* Adaptation AmiTex:        Chez Corbin, 18 septembre 1997  Version 2.00 */
  5. /* Adaptation AmiCAD:        Chez Corbin, 22 Février 1998    Version 2.00 */
  6. /* Ajout traitement du nom si Innomé:      6 Février 1999    Version 2.01 */
  7. /* Adaptation MENU:        Chez Corbin, 22 Mai 1999        Version 2.02 */
  8. /* Adaptation Version 2.05  Chez Corbin, 13 Avril 2000        Version 2.03 */
  9. /* Localisation anglais/français     11 Novembre 2000   Version 2.04 */
  10. /* $VER: SauverAuto.AmiCAD 2.04 (© R.Florac, 11/11/2000) */
  11.  
  12. port = address()
  13. options results
  14.  
  15. 'LANGUAGE'
  16. if result="français.language" then fr=1
  17. else fr=0
  18.  
  19. signal ON error     /* pour interrompre quand le programme quitte */
  20.  
  21. cr = '0a'x
  22.  
  23. sauver_auto=getclip(sauvegarde.port)
  24. if sauver_auto=1 then do        /* Version 1.02 */
  25.     a=setclip(sauvegarde.port,"")
  26.     if fr=1 then 'MESSAGE("Sauvegarde automatique"+CHR(10)+"interrompue.")'
  27.     else 'MESSAGE("Automatic saving"+CHR(10)+"interrupted.")'
  28.     exit
  29. end
  30.  
  31. if ~show('l', 'rexxsupport.library') then
  32. do
  33.     if ~addlib('rexxsupport.library',0,-30,0) then do
  34.     if fr=1 then 'MESSAGE("Installez rexxsupport.library"+CHR(10)+"dans votre répertoire libs: avant"+CHR(10)+"d''utiliser cette macro")'
  35.     else 'MESSAGE("Install rexxsupport.library"+CHR(10)+"in your libs: drawer before"+CHR(10)+"calling this script")'
  36.     exit    /* version 1.02 */
  37.     end
  38. end
  39.  
  40. a=setclip(sauvegarde.port,1)
  41. if fr=1 then 'MESSAGE("Une sauvegarde automatique"+CHR(10)+"aura lieu toutes les deux"+CHR(10)+"minutes si le contenu de cette"+CHR(10)+"fenêtre a été modifié."+CHR(10)+"Sélectionnez à nouveau ce script"+CHR(10)+"pour arrêter son exécution.")'
  42. else 'MESSAGE("An automatic saving"+CHR(10)+"will happen all two"+CHR(10)+"minutes if the content of this"+CHR(10)+"window has been modified."+CHR(10)+"Select again this script"+CHR(10)+"to stop its execution.")'
  43.  
  44. do forever            /* Boucle infinie */
  45.     call delay(6000)            /* Délai de deux minutes */
  46.     if ~show(p, port) then goto error
  47.     sauver_auto = getclip(sauvegarde.port)
  48.     if sauver_auto=1 then do
  49.     'MODIF'                 /* Test si texte modifié */
  50.     if result~=0 THEN do
  51.         'FILEPART("")'
  52.         if fr=1 then do
  53.         if result="Innomé" then do      /* Version 2.01 */
  54.             'REQUEST("Attention le fichier"+CHR(10)+"n''a pas été nommé, sa"+CHR(10)+"sauvegarde est donc impossible"+CHR(10)+"voulez-vous le nommer?")'
  55.             if result<1 then exit
  56.             'MENU("Rename")'
  57.             'FILEPART("")'
  58.             if result="Innomé" then exit
  59.         end
  60.         end
  61.         else do
  62.         if result="Unamed" then do
  63.             'REQUEST("Warning: the file"+CHR(10)+"has not been named, its"+CHR(10)+"saving is impossible"+CHR(10)+"Do-you want to name it?")'
  64.             if result<1 then exit
  65.             'MENU("Rename")'
  66.             'FILEPART("")'
  67.             if result="Unamed" then exit
  68.         end
  69.         end
  70.         'MENU("Save")'      /* Sauvegarde du texte */
  71.     end
  72.     end
  73.     else
  74.     exit
  75. end
  76.  
  77. error:
  78.     a=setclip(sauvegarde.port,"")
  79.     exit
  80.